#include  <stdio.h>

int res[10001];

int main(int argc, char *argv[])
{
	int a,b,index,max;
	while( scanf("%d %d",&a,&b) != EOF )
	{
		int i = a, j = b;
		if( a > b )
		{
			int temp = a;
			a = b;
			b = temp;
		}

		index = a;
		max=0;
		
		for( int i = a; i<=b ; ++i )
		{
			if( res[i]!=0 )
			{
				if(res[i]>max)
				{
					index=i;
					max = res[i];
				}
			} 
			else
			{
				int total = 1;
				int k=i;
				while( k != 1 )
				{
					if( k%2 == 0 )
					{
						k/=2;
					}
					else
						k=3*k+1;
					total++;
				}
				res[i]=total;
				if( total>max )
				{
					index=i;
					max=total;
				}
			}
		}

		printf("%d %d %d\n",i,j,max);
	}

}
